
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>初识 Vue3 · 《前端学习笔记》</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="XiaoChen">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ancre-navigation/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../MicroApp/qiankun/" />
    
    
    <link rel="prev" href="../Vue2/VueCli 3 项目配置.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">前言</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Android</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../Android/Android 多包名打包应用.html">
            
                <a href="../Android/Android 多包名打包应用.html">
            
                    
                    Android 多包名打包应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../Android/Android UI美化之 shape的使用及其属性总结.html">
            
                <a href="../Android/Android UI美化之 shape的使用及其属性总结.html">
            
                    
                    Android UI美化之 shape的使用及其属性总结
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">ReactNative</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../ReactNative/CodePush 热更新配置及使用.html">
            
                <a href="../ReactNative/CodePush 热更新配置及使用.html">
            
                    
                    CodePush 热更新配置及使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../ReactNative/已有Android工程 集成React Native.html">
            
                <a href="../ReactNative/已有Android工程 集成React Native.html">
            
                    
                    已有Android工程 集成React Native
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Egret</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../Egret/Egret 白鹭引擎参考资料.html">
            
                <a href="../Egret/Egret 白鹭引擎参考资料.html">
            
                    
                    Egret 白鹭引擎参考资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../Egret/EGER PRO.html">
            
                <a href="../Egret/EGER PRO.html">
            
                    
                    EGER PRO
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../Egret/Egret 寻路.html">
            
                <a href="../Egret/Egret 寻路.html">
            
                    
                    Egret 寻路
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">工具</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../Tools/homebrew 使用.html">
            
                <a href="../Tools/homebrew 使用.html">
            
                    
                    homebrew 使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../Tools/git 使用.html">
            
                <a href="../Tools/git 使用.html">
            
                    
                    git 使用
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">小程序</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../MiniApp/Atom 完美支持 WePY 小程序开发.html">
            
                <a href="../MiniApp/Atom 完美支持 WePY 小程序开发.html">
            
                    
                    Atom 完美支持 WePY 小程序开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../MiniApp/Atom 插件安装慢解决方案.html">
            
                <a href="../MiniApp/Atom 插件安装慢解决方案.html">
            
                    
                    Atom 插件安装慢解决方案
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Vue</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="../Vue2/Web 前端环境搭建.html">
            
                <a href="../Vue2/Web 前端环境搭建.html">
            
                    
                    Web 前端环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="../Vue2/Vue 项目搭建.html">
            
                <a href="../Vue2/Vue 项目搭建.html">
            
                    
                    Vue 项目搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="../Vue2/初识 VueCli 3.html">
            
                <a href="../Vue2/初识 VueCli 3.html">
            
                    
                    初识 VueCli 3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="../Vue2/使用 VueCli 3.html">
            
                <a href="../Vue2/使用 VueCli 3.html">
            
                    
                    使用 VueCli 3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="../Vue2/VueCli 3 项目配置.html">
            
                <a href="../Vue2/VueCli 3 项目配置.html">
            
                    
                    VueCli 3 项目配置
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="7.6" data-path="Vue3探索.html">
            
                <a href="Vue3探索.html">
            
                    
                    初识 Vue3
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">微前端</li>
        
        
    
        <li class="chapter " data-level="8.1" data-path="../MicroApp/qiankun/">
            
                <a href="../MicroApp/qiankun/">
            
                    
                    qiankun
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">团队成长</li>
        
        
    
        <li class="chapter " data-level="9.1" data-path="../Team/Web前端开发规范.html">
            
                <a href="../Team/Web前端开发规范.html">
            
                    
                    开发规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="../Team/Web团队建设--npm私库搭建.html">
            
                <a href="../Team/Web团队建设--npm私库搭建.html">
            
                    
                    私库搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="../Team/Web团队建设--自定义脚手架.html">
            
                <a href="../Team/Web团队建设--自定义脚手架.html">
            
                    
                    脚手架搭建
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >初识 Vue3</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#&#x521D;&#x8BC6;-vue3"><b></b>&#x521D;&#x8BC6; Vue3</a></li><ul><li><span class="title-icon "></span><a href="#&#x9879;&#x76EE;&#x521B;&#x5EFA;"><b></b>&#x9879;&#x76EE;&#x521B;&#x5EFA;</a></li><ul><li><span class="title-icon "></span><a href="#vue2"><b></b>Vue2</a></li><li><span class="title-icon "></span><a href="#vue3"><b></b>Vue3</a></li></ul><li><span class="title-icon "></span><a href="#&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;"><b></b>&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;</a></li><ul><li><span class="title-icon "></span><a href="#&#x6253;&#x5305;&#x914D;&#x7F6E;"><b></b>&#x6253;&#x5305;&#x914D;&#x7F6E;</a></li><li><span class="title-icon "></span><a href="#&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;"><b></b>&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;</a></li></ul><li><span class="title-icon "></span><a href="#&#x751F;&#x547D;&#x5468;&#x671F;"><b></b>&#x751F;&#x547D;&#x5468;&#x671F;</a></li><ul><li><span class="title-icon "></span><a href="#vue2_2"><b></b>Vue2</a></li><li><span class="title-icon "></span><a href="#vue3_2"><b></b>Vue3</a></li></ul><li><span class="title-icon "></span><a href="#&#x9009;&#x9879;&#x5F0F;&#x7EC4;&#x5408;&#x5F0F;"><b></b>&#x9009;&#x9879;&#x5F0F;/&#x7EC4;&#x5408;&#x5F0F;</a></li><li><span class="title-icon "></span><a href="#&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;"><b></b>&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;"><b></b>&#x7EC4;&#x4EF6;</a></li><ul><li><span class="title-icon "></span><a href="#vue-2"><b></b>Vue 2</a></li><li><span class="title-icon "></span><a href="#vue-3"><b></b>Vue 3</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;-ref-&#x533A;&#x522B;"><b></b>&#x7EC4;&#x4EF6; Ref &#x533A;&#x522B;</a></li></ul><li><span class="title-icon "></span><a href="#&#x8DEF;&#x7531;"><b></b>&#x8DEF;&#x7531;</a></li><ul><li><span class="title-icon "></span><a href="#&#x57FA;&#x7840;&#x7528;&#x6CD5;"><b></b>&#x57FA;&#x7840;&#x7528;&#x6CD5;</a></li><li><span class="title-icon "></span><a href="#keepalive&#x533A;&#x522B;"><b></b>KeepAlive&#x533A;&#x522B;</a></li></ul><li><span class="title-icon "></span><a href="#&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;"><b></b>&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;</a></li><ul><li><span class="title-icon "></span><a href="#vuex"><b></b>Vuex</a></li><li><span class="title-icon "></span><a href="#pinia"><b></b>Pinia</a></li></ul><li><span class="title-icon "></span><a href="#&#x8BA1;&#x7B97;&#x5C5E;&#x6027;"><b></b>&#x8BA1;&#x7B97;&#x5C5E;&#x6027;</a></li><li><span class="title-icon "></span><a href="#&#x4FA6;&#x542C;&#x5668;"><b></b>&#x4FA6;&#x542C;&#x5668;</a></li><li><span class="title-icon "></span><a href="#&#x53EF;&#x590D;&#x7528;&#x6027;"><b></b>&#x53EF;&#x590D;&#x7528;&#x6027;</a></li><ul><li><span class="title-icon "></span><a href="#&#x6DF7;&#x5165;"><b></b>&#x6DF7;&#x5165;</a></li><li><span class="title-icon "></span><a href="#&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;"><b></b>&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;</a></li><li><span class="title-icon "></span><a href="#&#x8FC7;&#x6EE4;&#x5668;"><b></b>&#x8FC7;&#x6EE4;&#x5668;</a></li></ul></ul></ul></div><a href="#&#x521D;&#x8BC6;-vue3" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x521D;&#x8BC6;-vue3"><a name="&#x521D;&#x8BC6;-vue3" class="anchor-navigation-ex-anchor" href="#&#x521D;&#x8BC6;-vue3"><i class="fa fa-link" aria-hidden="true"></i></a>&#x521D;&#x8BC6; Vue3</h1>
<h2 id="&#x9879;&#x76EE;&#x521B;&#x5EFA;"><a name="&#x9879;&#x76EE;&#x521B;&#x5EFA;" class="anchor-navigation-ex-anchor" href="#&#x9879;&#x76EE;&#x521B;&#x5EFA;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9879;&#x76EE;&#x521B;&#x5EFA;</h2>
<h3 id="vue2"><a name="vue2" class="anchor-navigation-ex-anchor" href="#vue2"><i class="fa fa-link" aria-hidden="true"></i></a>Vue2</h3>
<ul>
<li><p><a href="https://cli.vuejs.org/zh/" target="_blank">VueCli</a></p>
<pre><code class="lang-bash">$ vue create hello-world
</code></pre>
</li>
</ul>
<h3 id="vue3"><a name="vue3" class="anchor-navigation-ex-anchor" href="#vue3"><i class="fa fa-link" aria-hidden="true"></i></a>Vue3</h3>
<ul>
<li><p><a href="https://vitejs.cn/" target="_blank">Vite</a></p>
<pre><code class="lang-bash">$ npm init vite@latest
</code></pre>
</li>
</ul>
<blockquote>
<p><code>cli</code>&#x521B;&#x5EFA;&#x9879;&#x76EE;&#x65F6;&#x53EF;&#x76F4;&#x63A5;&#x9009;&#x62E9;&#x5B89;&#x88C5;<code>sass-loader</code>&#x3001;<code>vue-router</code>&#x3001;<code>Vuex</code>&#xFF0C;<code>vite</code>&#x5219;&#x9700;&#x9879;&#x76EE;&#x521B;&#x5EFA;&#x5B8C;&#x6210;&#x540E;&#x624B;&#x52A8;&#x914D;&#x7F6E;</p>
<p>&#x6B64;&#x5916;<code>vite</code>&#x63D0;&#x4F9B;&#x4E86;&#x5BF9; <code>.scss</code>, <code>.sass</code>, <code>.less</code>, <code>.styl</code> &#x548C; <code>.stylus</code> &#x6587;&#x4EF6;&#x7684;&#x5185;&#x7F6E;&#x652F;&#x6301;&#xFF0C;&#x65E0;&#x9700;&#x6DFB;&#x52A0;&#x54CD;&#x5E94;<code>loader</code>&#x53EA;&#x9700;&#x6DFB;&#x52A0;&#x54CD;&#x5E94;&#x9884;&#x5904;&#x7406;&#x5668;&#x4F9D;&#x8D56;&#x5373;&#x53EF;</p>
</blockquote>
<pre><code class="lang-bash"><span class="hljs-comment"># .scss and .sass</span>
$ npm install -D sass

<span class="hljs-comment"># .less</span>
$ npm install -D less
</code></pre>
<h2 id="&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;"><a name="&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;" class="anchor-navigation-ex-anchor" href="#&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9879;&#x76EE;&#x57FA;&#x7840;&#x914D;&#x7F6E;</h2>
<h3 id="&#x6253;&#x5305;&#x914D;&#x7F6E;"><a name="&#x6253;&#x5305;&#x914D;&#x7F6E;" class="anchor-navigation-ex-anchor" href="#&#x6253;&#x5305;&#x914D;&#x7F6E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6253;&#x5305;&#x914D;&#x7F6E;</h3>
<h4 id="vue2_1"><a name="vue2_1" class="anchor-navigation-ex-anchor" href="#vue2_1"><i class="fa fa-link" aria-hidden="true"></i></a>Vue2</h4>
<p><a href="https://cli.vuejs.org/zh/config/" target="_blank">vue.config.js</a></p>
<h4 id="vue3_1"><a name="vue3_1" class="anchor-navigation-ex-anchor" href="#vue3_1"><i class="fa fa-link" aria-hidden="true"></i></a>Vue3</h4>
<p><a href="https://vitejs.cn/config/" target="_blank">vite.config.js</a></p>
<h3 id="&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;"><a name="&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;" class="anchor-navigation-ex-anchor" href="#&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x914D;&#x7F6E;</h3>
<p>&#x5168;&#x5C40;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x5747;&#x914D;&#x7F6E;&#x4E8E;&#x9879;&#x76EE;<code>.env</code>&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x6B64;&#x5904;&#x533A;&#x522B;&#x4E8E;<code>cli</code>&#x4E2D;&#x81EA;&#x5B9A;&#x4E49;&#x53D8;&#x91CF;&#x9700;&#x4EE5;<code>VUE_APP_</code>&#x4E3A;&#x524D;&#x7F00;&#xFF0C;&#x53C2;&#x8003; <a href="https://cli.vuejs.org/zh/guide/mode-and-env.html#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" target="_blank">cli &#x73AF;&#x5883;&#x53D8;&#x91CF;</a>&#xFF1B;<code>vite</code>&#x4E2D;&#x4EE5;<code>VITE_</code>&#x4E3A;&#x524D;&#x7F00;&#x5B9A;&#x4E49;&#xFF0C;&#x53C2;&#x8003; <a href="https://vitejs.cn/guide/env-and-mode.html#env-files" target="_blank">vite &#x73AF;&#x5883;&#x53D8;&#x91CF;</a>&#x3002;</p>
<p>&#x4F7F;&#x7528;&#x65B9;&#x5F0F;&#x4E5F;&#x5B58;&#x5728;&#x533A;&#x522B;&#xFF0C;<code>cli</code> &#x4E2D;&#x4F7F;&#x7528;<code>process.env.VUE_APP_***</code>&#x65B9;&#x5F0F;&#x83B7;&#x53D6;&#x53D8;&#x91CF;&#x503C;&#xFF1B;<code>vite</code>&#x4E2D;&#x4F7F;&#x7528;<code>import.meta.env.VITE_***</code>&#x3002;</p>
<h2 id="&#x751F;&#x547D;&#x5468;&#x671F;"><a name="&#x751F;&#x547D;&#x5468;&#x671F;" class="anchor-navigation-ex-anchor" href="#&#x751F;&#x547D;&#x5468;&#x671F;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x751F;&#x547D;&#x5468;&#x671F;</h2>
<h3 id="vue2_2"><a name="vue2_2" class="anchor-navigation-ex-anchor" href="#vue2_2"><i class="fa fa-link" aria-hidden="true"></i></a>Vue2</h3>
<p><img src="https://v2.cn.vuejs.org/images/lifecycle.png" alt="Vue2&#x751F;&#x547D;&#x5468;&#x671F;" style="width: 700px"></p>
<h3 id="vue3_2"><a name="vue3_2" class="anchor-navigation-ex-anchor" href="#vue3_2"><i class="fa fa-link" aria-hidden="true"></i></a>Vue3</h3>
<p><img src="https://cn.vuejs.org/assets/lifecycle.16e4c08e.png" alt="Vue3&#x751F;&#x547D;&#x5468;&#x671F;" style="width: 700px"></p>
<h2 id="&#x9009;&#x9879;&#x5F0F;&#x7EC4;&#x5408;&#x5F0F;"><a name="&#x9009;&#x9879;&#x5F0F;&#x7EC4;&#x5408;&#x5F0F;" class="anchor-navigation-ex-anchor" href="#&#x9009;&#x9879;&#x5F0F;&#x7EC4;&#x5408;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9009;&#x9879;&#x5F0F;/&#x7EC4;&#x5408;&#x5F0F;</h2>
<p><code>Vue2</code>&#x4E2D;&#x7684;&#x5199;&#x6CD5;&#x5373;&#x9009;&#x9879;&#x5F0F;Api&#x65B9;&#x5F0F;</p>
<pre><code class="lang-vue">&lt;script&gt;
export default {
  name: &apos;Test&apos;,
  data () {
    return {
      message: &apos;TestMessage&apos;,
    }
  },
  methods: {
    handleClick () {
      console.log(this.message);
    },
  }
}
&lt;/script&gt;
</code></pre>
<blockquote>
<p>&#x9009;&#x9879;&#x5F0F;Api&#x5373;&#x5BFC;&#x51FA;&#x4E3A;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5185;&#x90E8;&#x901A;&#x8FC7;&#x914D;&#x7F6E;&#x5404;&#x9009;&#x9879;&#x5B9E;&#x73B0;&#x529F;&#x80FD;&#xFF0C;&#x4F8B;<code>name</code>&#x3001;<code>data</code>&#x3001;<code>methods</code>&#x7B49;&#x9009;&#x9879;&#x3002;</p>
</blockquote>
<p><code>Vue3</code>&#x4E2D;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x7684;&#x5199;&#x6CD5;&#x4E3A;&#x7EC4;&#x5408;&#x5F0F;&#x5199;&#x6CD5;</p>
<pre><code class="lang-vue">&lt;script setup&gt;
const message = ref(&apos;TestMessage&apos;);
const handleClick = () =&gt; {
  console.log(message.value);
}
&lt;/script&gt;
</code></pre>
<blockquote>
<p>&#x603B;&#x7ED3;</p>
<p>&#x9009;&#x9879;&#x5F0F;Api&#xFF1A;</p>
<p>&#x4F18;&#x70B9;&#xFF1A;&#x7531;&#x4E8E;&#x5404;&#x9009;&#x9879;&#x804C;&#x8D23;&#x660E;&#x786E;&#x6240;&#x4EE5;&#x66F4;&#x6613;&#x4E8E;&#x5B66;&#x4E60;&#x548C;&#x4F7F;&#x7528;</p>
<p>&#x7F3A;&#x70B9;&#xFF1A;&#x4EE3;&#x7801;&#x7EC4;&#x7EC7;&#x6027;&#x76F8;&#x5BF9;&#x8F83;&#x5DEE;&#xFF0C;&#x76F8;&#x4F3C;&#x7684;&#x903B;&#x8F91;&#x4EE3;&#x7801;&#x4E0D;&#x4FBF;&#x4E8E;&#x590D;&#x7528;&#x4E14;&#x903B;&#x8F91;&#x590D;&#x6742;&#x5EA6;&#x8F83;&#x9AD8;&#x65F6;&#x4EE3;&#x7801;&#x53EF;&#x8BFB;&#x6027;&#x4F1A;&#x964D;&#x4F4E;</p>
<p>&#x7EC4;&#x5408;&#x5F0F;Api&#xFF1A;</p>
<p>&#x4F18;&#x70B9;&#xFF1A;&#x529F;&#x80FD;&#x903B;&#x8F91;&#x590D;&#x6742;&#x65F6;&#xFF0C;&#x5404;&#x4E2A;&#x529F;&#x80FD;&#x903B;&#x8F91;&#x4EE3;&#x7801;&#x7EC4;&#x7EC7;&#x5728;&#x4E00;&#x8D77;&#xFF0C;&#x4FBF;&#x4E8E;&#x9605;&#x8BFB;&#x548C;&#x7EF4;&#x62A4;</p>
<p>&#x7F3A;&#x70B9;&#xFF1A;&#x5BF9;&#x4E8E;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#x8005;&#x672C;&#x8EAB;&#x6709;&#x4E00;&#x5B9A;&#x7684;&#x4EE3;&#x7801;&#x7EC4;&#x7EC7;&#x80FD;&#x529B;&#x7684;&#x8981;&#x6C42;&#xFF0C;&#x9700;&#x8981;&#x6709;&#x826F;&#x597D;&#x7684;&#x4EE3;&#x7801;&#x7EC4;&#x7EC7;&#x80FD;&#x529B;&#x548C;&#x62C6;&#x5206;&#x903B;&#x8F91;&#x80FD;&#x529B;</p>
<p>&#x7EC4;&#x5408;&#x5F0F; API &#x7684;&#x51FA;&#x73B0;&#x662F;&#x4E3A;Vue&#x65B0;&#x589E;&#x8D4B;&#x80FD;&#xFF0C;&#x5E76;&#x4E0D;&#x662F;&#x4E3A;&#x4E86;&#x53D6;&#x4EE3;&#x9009;&#x9879;&#x5F0F; API&#xFF0C;&#x6545;&#x800C;<code>Vue3</code>&#x4E2D;&#x4ECD;&#x53EF;&#x4F7F;&#x7528;&#x9009;&#x9879;&#x5F0F;&#x4EE3;&#x7801;&#x98CE;&#x683C;&#x8FDB;&#x884C;&#x7F16;&#x5199;</p>
</blockquote>
<h2 id="&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;"><a name="&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;" class="anchor-navigation-ex-anchor" href="#&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x54CD;&#x5E94;&#x5F0F;&#x6570;&#x636E;</h2>
<pre><code class="lang-vue">&lt;template&gt;
&lt;span&gt;{{obj.a}}&lt;/span&gt;
&lt;/template&gt;
&lt;script&gt;
export default {
  data () {
    return {
      obj: {
        a: &apos;&apos;
      },
    };
  },
  methods: {
    appendParam () {
      this.$set(this.obj, &apos;b&apos;, 2);
    },
  }
}
&lt;/script&gt;
</code></pre>
<pre><code class="lang-vue">&lt;template&gt;
    &lt;span @click=&quot;objRef.b = 1&quot;&gt;{{objRef.b}}&lt;/span&gt;
&lt;/template&gt;
&lt;script setup&gt;
  const obj = reactive({a: 1});
  const appendParam = () =&gt; {
    obj.b = 2;
    console.log(obj.b)
  };
  const setObj = () =&gt; {
    Object.assign(obj, {c: 3});
  };
  const cleanObj = () =&gt; {
    Object.keys(obj).forEach(key =&gt; delete obj[key]);
  };

  const objRef = ref({});
  const setObjRef = () =&gt; {
    objRef.value = {a: 1, b: 2};
  };
  const cleanObjRef = () =&gt; {
    objRef.value = {};
    console.log(obj.value.b)
  };

  class ObjModel = {
    a = &apos;a&apos;
    b = &apos;b&apos;
  }
  const objModel = reactive(new ObjModel())

  const setObjModel = () =&gt; {
    objModel.c = &apos;c&apos;
  }
  const resetObjModel = () =&gt; {
    Object.assign(objModel, new ObjModel());
  }

  const arr = reactive([]);
  const changeArr = () =&gt; {
    arr.length = 0;
    arr.push(...[1, 2, 3]);
  };
&lt;/script&gt;
</code></pre>
<h2 id="&#x7EC4;&#x4EF6;"><a name="&#x7EC4;&#x4EF6;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x7EC4;&#x4EF6;</h2>
<h3 id="vue-2"><a name="vue-2" class="anchor-navigation-ex-anchor" href="#vue-2"><i class="fa fa-link" aria-hidden="true"></i></a>Vue 2</h3>
<pre><code class="lang-vue">&lt;script&gt;
export default {
  name: &apos;TestComponent&apos;,
  model: {
    prop: &apos;value&apos;,
    event: &apos;change&apos;
  },
  props: {
    value: {
      type: Boolean,
      default: false
    },
    message: {
      type: String,
      default: &apos;default-message&apos;
    }
  },
  methods: {
    handleClick () {
      this.$emit(&apos;customClick&apos;, &apos;text click&apos;)
      this.$emit(&apos;change&apos;, !this.value);
    }
  }
}
&lt;/script&gt;
</code></pre>
<h3 id="vue-3"><a name="vue-3" class="anchor-navigation-ex-anchor" href="#vue-3"><i class="fa fa-link" aria-hidden="true"></i></a>Vue 3</h3>
<pre><code class="lang-vue">&lt;script setup&gt;
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false,
  },
  message: {
    type: String,
    default: &apos;default-message&apos;
  }
});
const emits = defineEmits([&apos;customClick&apos;, &apos;update:modelValue&apos;])
const handleClick = () =&gt; {
  emits(&apos;customClick&apos;, &apos;text click&apos;)
  emits(&apos;update:modelValue&apos;, !props.modelValue)
}
const exposeFun = () =&gt; {
  console.log(&quot;I&apos;m public function&quot;)
}
defineExpose({
  exposeFun,
});
&lt;/script&gt;
</code></pre>
<h3 id="&#x7EC4;&#x4EF6;-ref-&#x533A;&#x522B;"><a name="&#x7EC4;&#x4EF6;-ref-&#x533A;&#x522B;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;-ref-&#x533A;&#x522B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x7EC4;&#x4EF6; Ref &#x533A;&#x522B;</h3>
<pre><code class="lang-vue">&lt;template&gt;
    &lt;input ref=&apos;input&apos;/&gt;
&lt;/template&gt;
&lt;script&gt;
export default {
  mounted() {
    this.$refs.input.focus();
  }
}
&lt;/script&gt;
</code></pre>
<pre><code class="lang-vue">&lt;template&gt;
    &lt;input ref=&apos;input&apos;/&gt;
&lt;/template&gt;
&lt;script setup&gt;
const input = ref(null)
const fun = () =&gt; {
  input.value?.focus()
}
onMounted(() =&gt; {
  input.value.focus()
})
&lt;/script&gt;
</code></pre>
<h2 id="&#x8DEF;&#x7531;"><a name="&#x8DEF;&#x7531;" class="anchor-navigation-ex-anchor" href="#&#x8DEF;&#x7531;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8DEF;&#x7531;</h2>
<h3 id="&#x57FA;&#x7840;&#x7528;&#x6CD5;"><a name="&#x57FA;&#x7840;&#x7528;&#x6CD5;" class="anchor-navigation-ex-anchor" href="#&#x57FA;&#x7840;&#x7528;&#x6CD5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x57FA;&#x7840;&#x7528;&#x6CD5;</h3>
<pre><code class="lang-vue">&lt;script&gt;
export default {
  created () {
    console.log(this.$route, this.$router)
  },
}
&lt;/script&gt;
</code></pre>
<pre><code class="lang-vue">&lt;script setup&gt;
const route = useRoute();
const router = useRouter();
&lt;/script&gt;
</code></pre>
<h3 id="keepalive&#x533A;&#x522B;"><a name="keepalive&#x533A;&#x522B;" class="anchor-navigation-ex-anchor" href="#keepalive&#x533A;&#x522B;"><i class="fa fa-link" aria-hidden="true"></i></a>KeepAlive&#x533A;&#x522B;</h3>
<pre><code class="lang-vue">&lt;template&gt;
  &lt;transition&gt;
    &lt;keep-alive&gt;
      &lt;router-view v-if=&quot;!$route.meta.keepAlive&quot;&gt;&lt;/router-view&gt;
    &lt;/keep-alive&gt;
    &lt;router-view v-if=&quot;$route.meta.keepAlive&quot;&gt;&lt;/router-view&gt;
  &lt;/transition&gt;
&lt;/template&gt;
</code></pre>
<pre><code class="lang-vue">&lt;template&gt;
    &lt;router-view v-slot=&quot;{ Component, route }&quot;&gt;
    &lt;keep-alive :include=&quot;cachedViews&quot;&gt;
      &lt;component :is=&quot;Component&quot; :key=&quot;route.path&quot; /&gt;
      &lt;/keep-alive&gt;
  &lt;/router-view&gt;
&lt;/template&gt;
</code></pre>
<h2 id="&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;"><a name="&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;" class="anchor-navigation-ex-anchor" href="#&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5168;&#x5C40;&#x72B6;&#x6001;&#x7BA1;&#x7406;</h2>
<h3 id="vuex"><a name="vuex" class="anchor-navigation-ex-anchor" href="#vuex"><i class="fa fa-link" aria-hidden="true"></i></a>Vuex</h3>
<p><a href="https://vuex.vuejs.org/zh/" target="_blank">&#x57FA;&#x672C;&#x4F7F;&#x7528;</a></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> Vuex <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;vuex&apos;</span>

Vue.use(Vuex)
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">new</span> Vuex.Store({
  state: {
    todos: [
      { id: <span class="hljs-number">1</span>, text: <span class="hljs-string">&apos;todo item done&apos;</span>, done: <span class="hljs-literal">true</span> },
      { id: <span class="hljs-number">2</span>, text: <span class="hljs-string">&apos;todo item not done&apos;</span>, done: <span class="hljs-literal">false</span> }
    ]
  },
  getters: {
    doneTodos: state =&gt; {
      <span class="hljs-keyword">return</span> state.todos.filter(todo =&gt; todo.done)
    }
  },
  mutations: {
    addTodo (state, todo) {
      state.todos.push(todo);
    }
  },
  actions: {
    addTodo ({state, commit}, todo) {
      commit(<span class="hljs-string">&apos;addTodo&apos;</span>, todo)
    }
  },
  modules: {}
})
</code></pre>
<h3 id="pinia"><a name="pinia" class="anchor-navigation-ex-anchor" href="#pinia"><i class="fa fa-link" aria-hidden="true"></i></a>Pinia</h3>
<p><a href="https://pinia.web3doc.top/getting-started.html" target="_blank">&#x57FA;&#x672C;&#x4F7F;&#x7528;</a></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> { createPinia } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;pinia&apos;</span>

app.use(createPinia())
</code></pre>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> { defineStore } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;pinia&apos;</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> useTodosStore = defineStore(<span class="hljs-string">&apos;todos&apos;</span>, {
  state: () =&gt; ({
    todos: [
      { id: <span class="hljs-number">1</span>, text: <span class="hljs-string">&apos;todo item done&apos;</span>, done: <span class="hljs-literal">true</span> },
      { id: <span class="hljs-number">2</span>, text: <span class="hljs-string">&apos;todo item not done&apos;</span>, done: <span class="hljs-literal">false</span> }
    ]
  }),
  getters: {
    doneTodos (state) {
      <span class="hljs-keyword">return</span> state.todos.filter(todo =&gt; todo.done)
    },
  },
  actions: {
    addTodo(text) {
      <span class="hljs-keyword">this</span>.todos.push({ text, id: <span class="hljs-number">3</span>, done: <span class="hljs-literal">false</span> })
    },
  }
})
</code></pre>
<pre><code class="lang-vue">&lt;script setup&gt;
  import { useTodosStore } from &apos;@/stores/todos&apos;
  const todoStore = useTodosStore();
  console.log(todoStore.doneTodos);
  // &#x66F4;&#x65B0;&#x6570;&#x636E;
  todoStore.todos.push({ text: &apos;&#x5916;&#x90E8;&#x6DFB;&#x52A0;&apos;, id: 4, done: false });
  todoStore.todos = [{ text: &apos;&#x5916;&#x90E8;&#x6DFB;&#x52A0;&apos;, id: 4, done: false }];
  // &#x6216;
  todoStore.$patch({ todos: [] });
  // &#x6216;
  todoStore.addTodo({ text: &apos;&#x5916;&#x90E8;&#x6DFB;&#x52A0;&apos;, id: 4, done: false });

&lt;/script&gt;
</code></pre>
<h2 id="&#x8BA1;&#x7B97;&#x5C5E;&#x6027;"><a name="&#x8BA1;&#x7B97;&#x5C5E;&#x6027;" class="anchor-navigation-ex-anchor" href="#&#x8BA1;&#x7B97;&#x5C5E;&#x6027;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8BA1;&#x7B97;&#x5C5E;&#x6027;</h2>
<pre><code class="lang-vue">&lt;script&gt;
export default {
  data () {
    return {
      count: 1,
    };
  },
  computed: {
    doubleCount () {
      return this.count * 2;
    }
  }
}
&lt;/script&gt;
</code></pre>
<pre><code class="lang-vue">&lt;script setup&gt;
  const count = ref(1);
    const doubleCount = computed(() =&gt; count.value * 2);
&lt;/script&gt;
</code></pre>
<h2 id="&#x4FA6;&#x542C;&#x5668;"><a name="&#x4FA6;&#x542C;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x4FA6;&#x542C;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4FA6;&#x542C;&#x5668;</h2>
<pre><code class="lang-vue">&lt;script&gt;
export default {
  data () {
    return {
      count: 1,
      countObj: {
        count: 1,
      }
    };
  },
  watch: {
    count (val) {
      console.log(&apos;watch - count&apos;, val);
    },
    &apos;countObj.count&apos; (val) {
      console.log(&apos;watch - countObj.count&apos;, val);
    },
  }
}
&lt;/script&gt;
</code></pre>
<pre><code class="lang-vue">&lt;script setup&gt;
  const count = ref(1);
  const countObj = reactive({count: 1});
  watch(count, (val) =&gt; {
    console.log(&apos;watch - count&apos;, val);
  });
  watch(() =&gt; countObj.count, (val) =&gt; {
    console.log(&apos;watch - countObj.count&apos;, val);
  });
&lt;/script&gt;
</code></pre>
<h2 id="&#x53EF;&#x590D;&#x7528;&#x6027;"><a name="&#x53EF;&#x590D;&#x7528;&#x6027;" class="anchor-navigation-ex-anchor" href="#&#x53EF;&#x590D;&#x7528;&#x6027;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x53EF;&#x590D;&#x7528;&#x6027;</h2>
<h3 id="&#x6DF7;&#x5165;"><a name="&#x6DF7;&#x5165;" class="anchor-navigation-ex-anchor" href="#&#x6DF7;&#x5165;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6DF7;&#x5165;</h3>
<pre><code class="lang-javascript"><span class="hljs-comment">// src/mixins/logMessage.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
    methods: {
        logMessage (message) {
            <span class="hljs-built_in">console</span>.log(message)
        },
    }
};
</code></pre>
<pre><code class="lang-vue">&lt;script&gt;
import LogMessage from &apos;@/mixins/logMessage&apos;;
export default {
  mixins: [LogMessage],
  mounted () {
    this.logMessage(&apos;mounted&apos;)
  }
}
&lt;/script&gt;
</code></pre>
<p><code>Vue3</code>&#x4E2D;&#x867D;&#x4FDD;&#x7559;&#x4E86;&#x5BF9;&#x4E8E;<code>mixin</code>&#x7684;&#x652F;&#x6301;&#x4F46;&#x4E5F;&#x4EC5;&#x4EC5;&#x662F;&#x4E3A;&#x4E86;&#x517C;&#x5BB9;&#x8001;&#x7248;&#x672C;&#x53CA;&#x5404;&#x4F9D;&#x8D56;&#x5E93;&#xFF0C;&#x5BF9;&#x4E8E; <code>Vue3</code> &#x6765;&#x8BF4;&#x8FD8;&#x662F;&#x5EFA;&#x8BAE;&#x7528; <code>&#x7EC4;&#x5408;&#x5F0F;&#x51FD;&#x6570;</code> &#x6765;&#x5B9E;&#x73B0;&#x590D;&#x7528;&#x90E8;&#x5206;&#x4EE3;&#x7801;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// logMessage.js</span>
<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">useMessage</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> logMessage = (message) =&gt; {
    <span class="hljs-built_in">console</span>.log(message)
  };
  <span class="hljs-keyword">return</span> { logMessage }
}
</code></pre>
<pre><code class="lang-vue">&lt;script setup&gt;
import { useMessage } from &apos;./logMessage.js&apos;

const { logMessage } = useMessage();
onMounted(() =&gt; {
  logMessage(&apos;mounted&apos;)
});
&lt;/script&gt;
</code></pre>
<h3 id="&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;"><a name="&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;" class="anchor-navigation-ex-anchor" href="#&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x81EA;&#x5B9A;&#x4E49;&#x6307;&#x4EE4;</h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  bind (el, binding, vnode) {},
  inserted () {},
  update () {},
  componentUpdated () {},
  unbind () {},
}
</code></pre>
<pre><code class="lang-javascript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  created(el, binding, vnode, prevVnode) {},
  beforeMount() {},
  mounted() {},
  beforeUpdate() {},
  updated() {},
  beforeUnmount() {},
  unmounted() {}
}
</code></pre>
<h3 id="&#x8FC7;&#x6EE4;&#x5668;"><a name="&#x8FC7;&#x6EE4;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x8FC7;&#x6EE4;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x8FC7;&#x6EE4;&#x5668;</h3>
<footer class="page-footer"><span class="copyright">Copyright &amp; copy zengqing.top 2023 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x66F4;&#x65B0;&#x4E8E;&#xFF1A;
2023-03-25 19:16:36
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../Vue2/VueCli 3 项目配置.html" class="navigation navigation-prev " aria-label="Previous page: VueCli 3 项目配置">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../MicroApp/qiankun/" class="navigation navigation-next " aria-label="Next page: qiankun">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"初识 Vue3","level":"7.6","depth":1,"next":{"title":"qiankun","level":"8.1","depth":1,"path":"MicroApp/qiankun/index.md","ref":"./MicroApp/qiankun/index.md","articles":[]},"previous":{"title":"VueCli 3 项目配置","level":"7.5","depth":1,"path":"Vue2/VueCli 3 项目配置.md","ref":"./Vue2/VueCli 3 项目配置.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","code","pageview-count","chapter-fold","expandable-chapters-small","tbfed-pagefooter","hide-element","ancre-navigation"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright & copy zengqing.top 2023","modify_label":"该文件更新于：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"pageview-count":{},"ancre-navigation":{"showLevel":true,"associatedWithSummary":true,"mode":"float","printLog":false,"multipleH1":true,"float":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"XiaoChen","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"《前端学习笔记》","language":"zh-hans","gitbook":"*","description":"个人学习笔记，记录学习过程中的点点滴滴"},"file":{"path":"Vue3/Vue3探索.md","mtime":"2023-03-25T11:16:36.896Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-03-26T04:06:26.355Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

